package app.android.kdictionary.aidl;

import android.os.Parcel;
import android.os.Parcelable;
import app.android.kdictionary.enums.SearchResultType;

public class WebViewContent implements Parcelable {
	private int 	idx;
	private String 	webViewString;
	private SearchResultType type;
//	private boolean isProgressBar;

	public static final Parcelable.Creator<WebViewContent> CREATOR = new Parcelable.Creator<WebViewContent>() {
		@Override
		public WebViewContent createFromParcel(Parcel in) {
			return new WebViewContent(in);
		}

		@Override
		public WebViewContent[] newArray(int size) {
			return new WebViewContent[size];
		}
	};
	
    public WebViewContent() {
    	this(-1, "");
    }
    
    public WebViewContent(int idx, String webViewString) {
    	this(idx, webViewString, SearchResultType.RESULT);
    }
    
    public WebViewContent(int idx, String webViewString, SearchResultType type) {
    	this.idx = idx;
    	this.webViewString = webViewString;
    	this.type = type;
//    	this.isProgressBar = isProgressBar;
    }
	
    private WebViewContent(Parcel in) {
        readFromParcel(in);
    }
	
	@Override
	public int describeContents() {
		return 0;
	}
	
	@Override
	public void writeToParcel(Parcel out, int flag) {
        out.writeInt(idx);
        out.writeString(webViewString);
	}

    public void readFromParcel(Parcel in) {
    	idx = in.readInt();
    	webViewString = in.readString();
    }

	public int getIdx() {
		return idx;
	}

	public void setIdx(int idx) {
		this.idx = idx;
	}

	public String getWebViewString() {
		return webViewString;
	}

	public void setWebViewString(String webViewString) {
		this.webViewString = webViewString;
	}

	public SearchResultType getType() {
		return type;
	}

	public void setType(SearchResultType type) {
		this.type = type;
	}
	
	

//	public boolean isProgressBar() {
//		return isProgressBar;
//	}
//
//	public void setProgressBar(boolean isProgressBar) {
//		this.isProgressBar = isProgressBar;
//	}
}
